import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createMessage: $message } = useMessage();

enum Api {
  list = '/customerTel/list',
  get = '/customerTel/queryById',
  delete = '/customerTel/delete',
  save = '/customerTel/add',
  edit = '/customerTel/edit',
}

/**
 * 列表
 * @param params
 */
export const list = async (params) => await defHttp.get({url: Api.list, params}, {isTransformResponse: false});

/**
 * 保存或者更新菜单
 * @param params
 */
export const customerTelAdd = (params) => {
  return defHttp.post({ url: Api.save, params }, { isTransformResponse: false });
}

/**
 * 保存或者更新菜单
 * @param params
 */
export const customerTelEdit = (params) => {
  return defHttp.post({ url: Api.edit, params }, { isTransformResponse: false });
}

/**
 * 删除
 */
export const customerTelDel = (params) => {
  return defHttp.delete({ url: Api.delete, params }, { joinParamsToUrl: true, isTransformResponse: false })
}

/**
 * 查询详情
 * @param params
 */
export const getCustomerById = (params) => {
  return defHttp.get({ url: Api.get, params });
}

